import { createRouter, createWebHashHistory } from 'vue-router';
import Home from '../views/Home.vue';
import channel from '../views/diany.vue'; // 确保路径正确
import Register from '../components/Register.vue'
import Login from '../components/Login.vue';
import My from '@/views/My.vue';
import MovieDetail from '@/components/MovieDetail.vue';
// 定义路由规则
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/channel',
    name: 'channel',
    component: channel
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/Register',
    name: 'Register',
    component: Register
  },
  {
    path: '/My',
    name: 'My',
    component: My
  },
  {
    path: '/movie/:id',
    name: 'MovieDetail',
    component: MovieDetail
  }
];

// 创建路由实例
const router = createRouter({
  history: createWebHashHistory(), // 使用 hash 模式
  routes
});

export default router;